home *** CD-ROM | disk | FTP | other *** search
- <refentry id="libgimp-gimpselection" revision="19 Jan 2001">
- <refmeta>
- <refentrytitle>gimpselection</refentrytitle>
- <manvolnum>3</manvolnum>
- <refmiscinfo>LIBGIMP Library</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>gimpselection</refname><refpurpose></refpurpose>
- </refnamediv>
-
- <refsynopsisdiv><title>Synopsis</title>
- <synopsis>
-
-
-
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-selection-bounds">gimp_selection_bounds</link> (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gboolean">gboolean</link> *non_empty,
- <link linkend="gint">gint</link> *x1,
- <link linkend="gint">gint</link> *y1,
- <link linkend="gint">gint</link> *x2,
- <link linkend="gint">gint</link> *y2);
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-selection-all">gimp_selection_all</link> (<link linkend="gint32">gint32</link> image_ID);
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-selection-none">gimp_selection_none</link> (<link linkend="gint32">gint32</link> image_ID);
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-selection-clear">gimp_selection_clear</link> (<link linkend="gint32">gint32</link> image_ID);
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-selection-is-empty">gimp_selection_is_empty</link> (<link linkend="gint32">gint32</link> image_ID);
- <link linkend="gint32">gint32</link> <link linkend="gimp-selection-float">gimp_selection_float</link> (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gint32">gint32</link> drawable_ID,
- <link linkend="gint">gint</link> offx,
- <link linkend="gint">gint</link> offy);
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-selection-load">gimp_selection_load</link> (<link linkend="gint32">gint32</link> channel_ID);
- <link linkend="gint32">gint32</link> <link linkend="gimp-selection-save">gimp_selection_save</link> (<link linkend="gint32">gint32</link> image_ID);
- <link linkend="gint">gint</link> <link linkend="gimp-selection-value">gimp_selection_value</link> (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gint">gint</link> x,
- <link linkend="gint">gint</link> y);
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-selection-grow">gimp_selection_grow</link> (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gint">gint</link> steps);
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-selection-shrink">gimp_selection_shrink</link> (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gint">gint</link> radius);
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-selection-invert">gimp_selection_invert</link> (<link linkend="gint32">gint32</link> image_ID);
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-selection-feather">gimp_selection_feather</link> (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gdouble">gdouble</link> radius);
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-selection-sharpen">gimp_selection_sharpen</link> (<link linkend="gint32">gint32</link> image_ID);
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-selection-border">gimp_selection_border</link> (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gint">gint</link> radius);
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-selection-translate">gimp_selection_translate</link> (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gint">gint</link> offx,
- <link linkend="gint">gint</link> offy);
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-selection-layer-alpha">gimp_selection_layer_alpha</link> (<link linkend="gint32">gint32</link> layer_ID);
- </synopsis>
- </refsynopsisdiv>
-
-
-
-
-
- <refsect1>
- <title>Description</title>
- <para>
-
- </para>
- </refsect1>
-
- <refsect1>
- <title>Details</title>
- <refsect2>
- <title><anchor id="gimp-selection-bounds">gimp_selection_bounds ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_selection_bounds (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gboolean">gboolean</link> *non_empty,
- <link linkend="gint">gint</link> *x1,
- <link linkend="gint">gint</link> *y1,
- <link linkend="gint">gint</link> *x2,
- <link linkend="gint">gint</link> *y2);</programlisting>
- <para>
- Find the bounding box of the current selection.
- </para>
- <para>
- This procedure returns whether there is a selection for the
- specified image. If there is one, the upper left and lower right
- corners of the bounding box are returned. These coordinates are
- relative to the image.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>image_ID</parameter> :</entry>
- <entry> The image.
- </entry></row>
- <row><entry align="right"><parameter>non_empty</parameter> :</entry>
- <entry> True if there is a selection.
- </entry></row>
- <row><entry align="right"><parameter>x1</parameter> :</entry>
- <entry> x coordinate of upper left corner of selection bounds.
- </entry></row>
- <row><entry align="right"><parameter>y1</parameter> :</entry>
- <entry> y coordinate of upper left corner of selection bounds.
- </entry></row>
- <row><entry align="right"><parameter>x2</parameter> :</entry>
- <entry> x coordinate of lower right corner of selection bounds.
- </entry></row>
- <row><entry align="right"><parameter>y2</parameter> :</entry>
- <entry> y coordinate of lower right corner of selection bounds.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-selection-all">gimp_selection_all ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_selection_all (<link linkend="gint32">gint32</link> image_ID);</programlisting>
- <para>
- Select all of the image.
- </para>
- <para>
- This procedure sets the selection mask to completely encompass the
- image. Every pixel in the selection channel is set to 255.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>image_ID</parameter> :</entry>
- <entry> The image.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-selection-none">gimp_selection_none ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_selection_none (<link linkend="gint32">gint32</link> image_ID);</programlisting>
- <para>
- Deselect the entire image.
- </para>
- <para>
- This procedure deselects the entire image. Every pixel in the
- selection channel is set to 0.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>image_ID</parameter> :</entry>
- <entry> The image.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-selection-clear">gimp_selection_clear ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_selection_clear (<link linkend="gint32">gint32</link> image_ID);</programlisting>
- <para>
- Set the selection to none, clearing all previous content.
- </para>
- <para>
- This procedure sets the selection mask to empty, assigning the value
- 0 to every pixel in the selection channel.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>image_ID</parameter> :</entry>
- <entry> The image.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-selection-is-empty">gimp_selection_is_empty ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_selection_is_empty (<link linkend="gint32">gint32</link> image_ID);</programlisting>
- <para>
- Determine whether the selection is empty.
- </para>
- <para>
- This procedure returns non-zero if the selection for the specified
- image is not empty.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>image_ID</parameter> :</entry>
- <entry> The image.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> Is the selection empty?
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-selection-float">gimp_selection_float ()</title>
- <programlisting><link linkend="gint32">gint32</link> gimp_selection_float (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gint32">gint32</link> drawable_ID,
- <link linkend="gint">gint</link> offx,
- <link linkend="gint">gint</link> offy);</programlisting>
- <para>
- Float the selection from the specified drawable with initial offsets
- as specified.
- </para>
- <para>
- This procedure determines the region of the specified drawable that
- lies beneath the current selection. The region is then cut from the
- drawable and the resulting data is made into a new layer which is
- instantiated as a floating selection. The offsets allow initial
- positioning of the new floating selection.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>image_ID</parameter> :</entry>
- <entry> ignored
- </entry></row>
- <row><entry align="right"><parameter>drawable_ID</parameter> :</entry>
- <entry> The drawable from which to float selection.
- </entry></row>
- <row><entry align="right"><parameter>offx</parameter> :</entry>
- <entry> x offset for translation.
- </entry></row>
- <row><entry align="right"><parameter>offy</parameter> :</entry>
- <entry> y offset for translation.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The floated layer.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-selection-load">gimp_selection_load ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_selection_load (<link linkend="gint32">gint32</link> channel_ID);</programlisting>
- <para>
- Transfer the specified channel to the selection mask.
- </para>
- <para>
- This procedure loads the specified channel into the selection mask.
- This essentially involves a copy of the channel's content in to the
- selection mask. Therefore, the channel must have the same width and
- height of the image, or an error is returned.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>channel_ID</parameter> :</entry>
- <entry> The channel.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-selection-save">gimp_selection_save ()</title>
- <programlisting><link linkend="gint32">gint32</link> gimp_selection_save (<link linkend="gint32">gint32</link> image_ID);</programlisting>
- <para>
- Copy the selection mask to a new channel.
- </para>
- <para>
- This procedure copies the selection mask and stores the content in a
- new channel. The new channel is automatically inserted into the
- image's list of channels.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>image_ID</parameter> :</entry>
- <entry> The image.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The new channel.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-selection-value">gimp_selection_value ()</title>
- <programlisting><link linkend="gint">gint</link> gimp_selection_value (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gint">gint</link> x,
- <link linkend="gint">gint</link> y);</programlisting>
- <para>
- Find the value of the selection at the specified coordinates.
- </para>
- <para>
- This procedure returns the value of the selection at the specified
- coordinates. If the coordinates lie out of bounds, 0 is returned.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>image_ID</parameter> :</entry>
- <entry> The image.
- </entry></row>
- <row><entry align="right"><parameter>x</parameter> :</entry>
- <entry> x coordinate of value.
- </entry></row>
- <row><entry align="right"><parameter>y</parameter> :</entry>
- <entry> y coordinate of value.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> Value of the selection.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-selection-grow">gimp_selection_grow ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_selection_grow (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gint">gint</link> steps);</programlisting>
- <para>
- Grow the image's selection
- </para>
- <para>
- This procedure grows the selection. Growing involves expanding the
- boundary in all directions by the specified pixel amount.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>image_ID</parameter> :</entry>
- <entry> The image.
- </entry></row>
- <row><entry align="right"><parameter>steps</parameter> :</entry>
- <entry> Steps of grow (in pixels).
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-selection-shrink">gimp_selection_shrink ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_selection_shrink (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gint">gint</link> radius);</programlisting>
- <para>
- Shrink the image's selection
- </para>
- <para>
- This procedure shrinks the selection. Shrinking invovles trimming
- the existing selection boundary on all sides by the specified number
- of pixels.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>image_ID</parameter> :</entry>
- <entry> The image.
- </entry></row>
- <row><entry align="right"><parameter>radius</parameter> :</entry>
- <entry> Radius of shrink (in pixels).
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-selection-invert">gimp_selection_invert ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_selection_invert (<link linkend="gint32">gint32</link> image_ID);</programlisting>
- <para>
- Invert the selection mask.
- </para>
- <para>
- This procedure inverts the selection mask. For every pixel in the
- selection channel, its new value is calculated as (255 - old_value).</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>image_ID</parameter> :</entry>
- <entry> The image.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-selection-feather">gimp_selection_feather ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_selection_feather (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gdouble">gdouble</link> radius);</programlisting>
- <para>
- Feather the image's selection
- </para>
- <para>
- This procedure feathers the selection. Feathering is implemented
- using a gaussian blur.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>image_ID</parameter> :</entry>
- <entry> The image.
- </entry></row>
- <row><entry align="right"><parameter>radius</parameter> :</entry>
- <entry> Radius of feather (in pixels).
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-selection-sharpen">gimp_selection_sharpen ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_selection_sharpen (<link linkend="gint32">gint32</link> image_ID);</programlisting>
- <para>
- Sharpen the selection mask.
- </para>
- <para>
- This procedure sharpens the selection mask. For every pixel in the
- selection channel, if the value is > 0, the new pixel is assigned a
- value of 255. This removes any \"anti-aliasing\" that might exist in
- the selection mask's boundary.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>image_ID</parameter> :</entry>
- <entry> The image.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-selection-border">gimp_selection_border ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_selection_border (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gint">gint</link> radius);</programlisting>
- <para>
- Border the image's selection
- </para>
- <para>
- This procedure borders the selection. Bordering creates a new
- selection which is defined along the boundary of the previous
- selection at every point within the specified radius.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>image_ID</parameter> :</entry>
- <entry> The image.
- </entry></row>
- <row><entry align="right"><parameter>radius</parameter> :</entry>
- <entry> Radius of border (in pixels).
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-selection-translate">gimp_selection_translate ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_selection_translate (<link linkend="gint32">gint32</link> image_ID,
- <link linkend="gint">gint</link> offx,
- <link linkend="gint">gint</link> offy);</programlisting>
- <para>
- Translate the selection by the specified offsets.
- </para>
- <para>
- This procedure actually translates the selection for the specified
- image by the specified offsets. Regions that are translated from
- beyond the bounds of the image are set to empty. Valid regions of
- the selection which are translated beyond the bounds of the image
- because of this call are lost.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>image_ID</parameter> :</entry>
- <entry> The image.
- </entry></row>
- <row><entry align="right"><parameter>offx</parameter> :</entry>
- <entry> x offset for translation.
- </entry></row>
- <row><entry align="right"><parameter>offy</parameter> :</entry>
- <entry> y offset for translation.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-selection-layer-alpha">gimp_selection_layer_alpha ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_selection_layer_alpha (<link linkend="gint32">gint32</link> layer_ID);</programlisting>
- <para>
- Transfer the specified layer's alpha channel to the selection mask.
- </para>
- <para>
- This procedure requires a layer with an alpha channel. The alpha
- channel information is used to create a selection mask such that for
- any pixel in the image defined in the specified layer, that layer
- pixel's alpha value is transferred to the selection mask. If the
- layer is undefined at a particular image pixel, the associated
- selection mask value is set to 0.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>layer_ID</parameter> :</entry>
- <entry> Layer with alpha.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
-
- </refsect1>
-
-
-
-
- </refentry>
-